﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/Site.Master" AutoEventWireup="true" CodeBehind="ton-giao.aspx.cs" Inherits="VanTaiTMS.Page.TonGiao" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <!---Check-all----->
<script type="text/javascript">
    function checkAll() {
        $('.bordered tbody tr').each(function () {
            if ($('input#chkAll').is(":checked")) {
                $('input#chkList').attr({ 'checked': 'checked' });
                $('input#chkList').parent().parent().css({ 'background': 'rgb(208, 233, 198)' });
            } else {
                $('input#chkList').attr({ 'checked': false });
                $('input#chkList').parent().parent().css({ 'background': '' });
            }
        });
    }
</script>
    <!-------End------->

    <!------Popup------>
    <script type="text/javascript">
        $(document).ready(function () {
            //setup new person dialog
            $('#tongiao').dialog({
                autoOpen: false,
                modal: true,
                draggable: true,
                height: "auto",
                width: "auto",
                position: ['center', 50],
                resizable: false,
                create: function (event) { $(event.target).parent().css('position', 'fixed'); },
                open: function () {
                    $(this).parent().appendTo("form");
                }
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            //setup new person dialog
            $('#ThemNhanhTinh').dialog({
                autoOpen: false,
                draggable: true,
                height: "auto",
                width: "auto",
                position: ['center', 50],
                resizable: false,
                create: function (event) { $(event.target).parent().css('position', 'fixed'); },
                open: function () {
                    $(this).parent().appendTo("form");
                }
            });
        });
    </script>

    <script type="text/javascript">
        $(document).ready(function () {
            //setup new person dialog
            $('#thongbao').dialog({
                autoOpen: false,
                draggable: true,
                height: "auto",
                width: "372px",
                position: ['center', 50],
                resizable: false,

                create: function (event) { $(event.target).parent().css('position', 'fixed'); },
                open: function () {
                    $(this).parent().appendTo("form");
                }
            });
        });
    </script>

    <script type="text/javascript">
        $(document).ready(function () {
            //setup new person dialog
            $('#thongbaoxoa').dialog({
                autoOpen: false,
                draggable: true,
                height: "auto",
                width: "372px",
                position: ['center', 50],
                resizable: false,

                create: function (event) { $(event.target).parent().css('position', 'fixed'); },
                open: function () {
                    $(this).parent().appendTo("form");
                }
            });
        });
    </script>
    <!-------End------->

    <!---AutoComplete-->
    <script type="text/javascript">
        function pageLoad() {
            $(document).ready((function () {
                var availableTags1 = [<%= SuggestionList %>];

                $("#<%= txtSearch.ClientID %>").autocomplete({
                    source: availableTags1
                });
            }));

            $(function () {
                $(".textboxngaynhap").datepicker({
                    showOn: "button",
                    buttonImage: "../images/calendar.gif",
                    dateFormat: 'dd/mm/yy',
                    changeMonth: true,
                    changeYear: true,
                    buttonImageOnly: true
                }).val();
            });

            $(function ($) {
                $(".textboxngaynhap").mask("99/99/9999"); //Kiem tra ngay nhap
                $("#phone").mask("(999) 999-9999"); //Kiem tra so dien thoai
                $("#tin").mask("99-9999999");
                $("#ssn").mask("999-99-9999");
            });

            //Check Row Hender Color
            $(document).ready(function () {
                $('.bordered tbody tr').click(function (event) {
                    if (event.target.type !== 'checkbox') {
                        $(':checkbox', this).trigger('click');
                    }
                });

                $("input[type='checkbox']").change(function (e) {
                    if ($(this).is(":checked")) {
                        $(this).closest('tr').css("background", "rgb(208, 233, 198)");
                    } else {
                        $(this).closest('tr').css("background", "");
                    }
                });
            });
        }
    </script>
    <!-------End------->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="upDatePanelAll" runat="server">
        <ContentTemplate>
            <div id="toolbar-1" class="yui3-toolbar">
                <asp:Panel id="panel1" runat="server" DefaultButton="cmdSerach">
                    <div class="div-search_A">
                        <asp:Button ID="cmdAddNew" CssClass="btn-add-new" runat="server" OnClick="cmdAddNew_Click" />
                        <asp:Button ID="cmdEdit" CssClass="btn-add-edit" runat="server" OnClick="cmdEdit_Click" />
                        <asp:Button ID="cmdDel" CssClass="btn-add-delete" OnClientClick="return confirmCheckIn(this);" runat="server" OnClick="cmdDel_Click" />
                    </div>

                    <div class="div-search-texbox">
                        <asp:TextBox ID="txtSearch" placeholder="Nhập vào từ khoá tìm kiếm..." CssClass="textbox_child" runat="server"></asp:TextBox>
                    </div>

                    <div class="div-search">
                        <asp:Button ID="cmdSerach" CssClass="btn-add-search" runat="server" OnClick="cmdSerach_Click" />
                        <asp:Button ID="cmdRefesh" CssClass="btn-add-refesh" runat="server" OnClick="cmdRefesh_Click" />
                    </div>
                </asp:Panel>
            <div class="clr"></div>
            </div>
            <%= StrAlert %>
            <!-----------Hiễn-Thị-Dữ-Liệu------------>
            <table class="bordered">
                <thead>
                    <tr>
                        <th width="5%">STT</th>
                        <th width="5%">
                            <input type="checkbox" onclick=" checkAll('chkList'); " id="chkAll">
                        </th>
                        <th width="10%">Mã Tôn Giáo</th>
                        <th width="15%">Tên Tôn Giáo</th>
                        <th width="40%">Ghi chú</th>
                    </tr>
                </thead>

                <tbody>
                    <asp:ListView ID="ListViewAll" runat="server" ItemPlaceholderID="lstViewAll" DataKeyNames="STT" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                        <ItemTemplate>
                            <tr>
                                <td style="text-align: center">
                                    <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("STT") %>'></asp:Label>
                                </td>

                                <td style="text-align: center">
                                    <asp:CheckBox ID="chkList" ClientIDMode="Static" runat="server" />
                                </td>

                                <td style="text-align: center">
                                    <asp:Label ID="lbDVTIntoMaVatTuCNBD" runat="server" Text='<%# Eval("MATonGiao") %>'></asp:Label>
                                    <input type="hidden" id="hiddenId" value='<%# Eval("STT") %>' runat="server" name="hiddenId" />
                                </td>

                                <td>
                                    <asp:LinkButton ID="linkTenTonGiao" CommandName="Accept" runat="server"><%# Eval("TENTonGiao") %></asp:LinkButton>
                                </td>

                                <td>
                                    <asp:Label ID="lbNote" runat="server" Text='<%# Eval("GHICHU") %>'></asp:Label>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <LayoutTemplate>
                            <asp:PlaceHolder runat="server" ID="lstViewAll"></asp:PlaceHolder>
                        </LayoutTemplate>
                    </asp:ListView>
                </tbody>
            </table>
            <!--------------Kêt-thúc----------------->

            <!-------------Phân-trang---------------->
            <table class="bordered">
                <thead>
                    <tr>
                        <th class="pager">
                            <asp:DataPager ID="DataPagerListAll" runat="server"
                                OnPreRender="DataPagerListAll_PreRender" PagedControlID="ListViewAll">
                                <Fields>
                                    <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;"
                                        ShowFirstPageButton="True" ShowNextPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;"
                                        ShowLastPageButton="True" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </th>
                    </tr>
                </thead>
            </table>
            <!--------------Kêt-thúc----------------->
        </ContentTemplate>
    </asp:UpdatePanel>
    <!-------------Edit-Dữ-Liệu-------------->
    <div id="tongiao" title="Cập nhật danh mục Tôn Giáo">
        <asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
            <ContentTemplate>
                <div class="toolbar-ui-all-big">
                    <asp:ImageButton CssClass="button-all" ID="imgSave" ImageAlign="Middle"
                        ImageUrl="~/Icon/save.png" runat="server"
                        OnClick="imgSave_Click" />

                    <asp:ImageButton CssClass="button-all" ID="imgrefesh" ImageAlign="Middle"
                        ImageUrl="~/Icon/refesh-ui.png" ToolTip="Làm tươi" runat="server"
                        OnClick="imgrefesh_Click" />
                </div>
                <div class="clr"></div>
                <div class="ui-main">
                    <div style="display: none">
                        <asp:Label ID="lbID" runat="server"></asp:Label>
                    </div>
                    <div class="ui-box-text-box">
                        <label class="label">Mã Tôn Giáo <span style="color:Red">(*)</span></label>
                        <asp:TextBox ID="txtMaTonGiao" CssClass="textbox" runat="server"></asp:TextBox>
                    </div>

                    <div class="ui-box-text-box">
                        <label class="label">Tên Tôn Giáo <span style="color:Red">(*)</span></label>
                        <asp:TextBox ID="txtTenTonGiao" CssClass="textbox" runat="server"></asp:TextBox>
                    </div>
                    <div class="clr"></div>

                    <div class="ui-box-text-box">
                        <label class="label">Ghi chú</label>
                        <asp:TextBox ID="txtGhiChu" TextMode="MultiLine" CssClass="textbox-muiti" runat="server"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="clr"></div>
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upNewUpdatePanel">
                    <ProgressTemplate>
                        <img alt='loadding' class="loading" src="../images/loading-fb.gif" /><br />
                        <div class="loading-label-right">
                            Đang xử lý dữ liệu...
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="imgSave" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <!--------------Kêt-thúc----------------->

    <!-------------Thông-Bao-Xoá------------->
    <div id="thongbaoxoa" title="Thông Báo">
        <asp:UpdatePanel ID="upDatePanelThongBaoXoa" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
            <ContentTemplate>
                <div style="display: none">
                    <asp:Label ID="lbIDXoa" runat="server" Text=""></asp:Label>
                </div>
                <p>
                    <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
                    <asp:Label ID="lbThongBaoXoa" CssClass="error-msg" runat="server" Text=""></asp:Label>
                </p>
                <hr />
                <div class="toolbar-ui-footer">
                    <asp:Button ID="cmdAgree" CssClass="btn btn-info" Height="29px" runat="server"
                        Text="Đồng ý" OnClick="cmdAgree_Click" />

                    <asp:Button ID="cmdClose" CssClass="btn btn-info" Height="29px" runat="server"
                        Text="Bỏ qua" OnClick="cmdClose_Click" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <!--------------Kêt-thúc----------------->

    <!-------------Thông-Bao----------------->
    <div id="thongbao" title="Thông Báo">
        <asp:UpdatePanel ID="updatePanelThongBao" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
            <ContentTemplate>
                <p>
                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                    <asp:Label ID="lbThongBaoLoi" CssClass="error-msg" runat="server" Text=""></asp:Label>
                </p>
                <hr />
                <div class="toolbar-ui-footer">
                    <asp:Button ID="cmdCloseThongBao" CssClass="btn btn-info" Height="29px" runat="server"
                        Text="Đóng lại" OnClick="cmdCloseThongBao_Click" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <!--------------Kêt-thúc----------------->
</asp:Content>
